#include<iostream>
#include<cstring>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
const int maxn = 100005;

int num[maxn],n;
string s;

void read(){
	int cnt=1,tmp=0;
	char c;
	for(int i=0;i<s.size();i++){
		c=s[i];
		if(c==','){
			num[cnt++]=tmp;
			tmp=0;
		}else if((c-'0')>=0 && (c-'0')<=9){
			tmp=tmp*10+c-'0';
		}
	}
	num[cnt]=tmp;
	n=cnt;
}



int main(){
	while(cin>>s){
		read();
		sort(num+1,num+1+n);
		cout<<num[n/2+1]<<endl;
		memset(num,0,sizeof num);
	}
	return 0;
}
